package cn.tedu.tongyi.service;

import org.springframework.ai.image.ImageResponse;

import java.util.Map;

public abstract class AbstractTongYiServiceImpl implements TongYiService{
    private static final String INFO_PREFIX = "please implement ";
    private static final String INFO_SUFFIX = "() method.";
    /**
     * 基本问答
     *
     * @param message
     */
    @Override
    public String completion(String message) {

        throw new RuntimeException(INFO_PREFIX + Thread.currentThread().getStackTrace()[2].getMethodName());
    }

    /**
     * 文生图
     *
     * @param imgPrompt
     */
    @Override
    public ImageResponse genImg(String imgPrompt) {

        throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
                .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
    }

    /**
     * 语音合成
     *
     * @param text
     */
    @Override
    public String genAudio(String text) {

        throw new RuntimeException(INFO_PREFIX + Thread.currentThread()
                .getStackTrace()[2].getMethodName() + INFO_SUFFIX);
    }

    public abstract Map<String, String> streamCompletion(String message);
}
